<template>
    <div class="api-info-form">
        <Row>
            <span class="form-label"><span class="red">*</span> 请求url：</span>
            <span v-if="!isEditing">{{apiDetail.apiPath}}</span>
            <Input v-if="isEditing" v-model="apiDetail.apiPath"></Input>
        </Row>
        <Row>
            <span class="form-label"><span class="red">*</span> 请求类型：</span>
            <span v-if="!isEditing">{{apiDetail.apiType}}</span>
            <Input v-if="isEditing" v-model="apiDetail.apiType"></Input>
        </Row>
        <Row>
            <span class="form-label"><span class="red">*</span> 接口描述：</span>
            <span v-if="!isEditing">{{apiDetail.apiDesc}}</span>
            <Input v-if="isEditing" v-model="apiDetail.apiDesc"></Input>
        </Row>
        <Row>
            <span class="form-label">beta域名：</span>
            <span v-if="!isEditing">{{apiDetail.betaDomain}}</span>
            <Input v-if="isEditing" v-model="apiDetail.betaDomain"></Input>
        </Row>
        <Row>
            <span class="form-label">生产域名：</span>
            <span v-if="!isEditing">{{apiDetail.prodDomain}}</span>
            <Input v-if="isEditing" v-model="apiDetail.prodDomain"></Input>
        </Row>
    </div>
</template>

<script>
    export default {
        name: 'ApiInfoForm',
        props: {
            apiDetail: {
                type: Object,
                default: () => {},
            },
            isEditing: {
                type: Boolean,
                default: false,
            }
        },
        data() {
            return {};
        },
        methods: {},
    }
</script>

<style lang="less" scoped>
    .api-info-form {
        font-size: 15px;
        .ivu-row {
            margin-top: 8px;
            .form-label {
                width: 100px;
                text-align: right;
                font-weight: 700;
                display: inline-block;
                .red {
                    color: red;
                }
            }
            .ivu-input-wrapper {
                width: 260px;
                .ivu-input {
                    font-size: 13px;
                }
            }
        }
    }
</style>